package com.chang.pojo;

import java.io.Serial;
import java.io.Serializable;

public class Goods {
    @Serial
    public static final long serialVersionUID = -10000L;
    private String goodsName;
    private String goodsId;
    private int inventory;
    private double price;
    private int time;

    public Goods() {
        time = 0;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getTime() {
        return time;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public void setInventory(int inventory) {
        this.inventory = inventory;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getPrice() {
        return price;
    }

    public int getInventory() {
        return inventory;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    @Override
    public String toString() {

        return String.format("%s, 库存: %d, 售价: %.2f", goodsName, getInventory(), getPrice());
    }
}
